﻿using System.Linq;
using Terraria;
using Terraria.DataStructures;
using WorseGame.Common.Cores.Custom.Interfaces;

namespace WorseGame.Common.Cores.Custom.Structs
{
    public readonly struct CatchWeight(int catchID, float catchWeight = 1f, params ICatchCondition[] additionalConditions)
    {
        public readonly int catchID = catchID;
        public readonly float catchWeight = catchWeight;
        public readonly ICatchCondition[] additionalConditions = additionalConditions;
        public bool AreConditionsMet(FishingAttempt attempt, Projectile bobber) => additionalConditions.All(condition => condition.IsConditionMet(attempt, bobber));
    }
}